function P=PP_step_player(G,P,k)
rr=P.GoalPos-P.pos;
ang_list=[atan2(rr(2),rr(1)),P.ang];
delta=0;
cnt=0;
while cnt>=0,
    for a=ang_list,
        ang=a+delta;
        pos=P.pos+P.speed*G.h*[cos(ang),sin(ang)];
        q=is_in_obstacle(pos,G.obstacles);
        q2=is_in_boundary(pos,G.boundary);
        if (q<=0 & q2>0)|norm(rr)<P.SensorRange,
            cnt=-1;
            break;
        end;
        cnt=cnt+1;
    end;
    delta=cnt/10*randn(1)*pi;
end;
P.ang=ang;
P.pos=pos;
P.is_gameover=norm(rr)<P.SensorRange;
